/*    */ package cc.s2m.web.s2mBlog.controller.base;
/*    */ 
/*    */ import org.apache.logging.log4j.LogManager;
/*    */ import org.apache.logging.log4j.Logger;
/*    */ import org.springframework.beans.TypeMismatchException;
/*    */ import org.springframework.dao.DataIntegrityViolationException;
/*    */ import org.springframework.web.bind.MissingServletRequestParameterException;
/*    */ import org.springframework.web.bind.annotation.ExceptionHandler;
/*    */ import org.springframework.web.bind.annotation.ResponseBody;
/*    */ 
/*    */ public class ExceptionBaseController
/*    */ {
/* 12 */   private static final Logger LOGGER = LogManager.getLogger(ExceptionBaseController.class);
/*    */ 
/*    */   @ExceptionHandler({TypeMismatchException.class})
/*    */   @ResponseBody
/*    */   public String handleTypeMismatchException(TypeMismatchException ex)
/*    */   {
/* 26 */     LOGGER.error("数据库异常：", ex);
/* 27 */     return ex.getMessage();
/*    */   }
/*    */ 
/*    */   @ExceptionHandler({DataIntegrityViolationException.class})
/*    */   @ResponseBody
/*    */   public String handleDataIntegrityViolationException(DataIntegrityViolationException ex)
/*    */   {
/* 41 */     LOGGER.error("数据库异常：", ex);
/* 42 */     return ex.getMessage();
/*    */   }
/*    */ 
/*    */   @ExceptionHandler({MissingServletRequestParameterException.class})
/*    */   @ResponseBody
/*    */   public String handleMissingServletRequestParameterException(MissingServletRequestParameterException ex)
/*    */   {
/* 56 */     LOGGER.error("handleException", ex);
/* 57 */     return ex.getMessage();
/*    */   }
/*    */ 
/*    */   @ExceptionHandler({Exception.class})
/*    */   @ResponseBody
/*    */   public String handleException(Exception ex)
/*    */   {
/* 72 */     LOGGER.error("handleException", ex);
/* 73 */     return ex.getMessage();
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.controller.base.ExceptionBaseController
 * JD-Core Version:    0.6.1
 */